public with sharing class newTestExtension {

    public newTestExtension(ValidateUserToRedirect controller) {

    }

    ApexPages.StandardController stdCtrl;
    // extension constructor
    
    public newTestExtension(ApexPages.StandardController std) {
    stdCtrl=std;
    }
    
    public PageReference save()
    {
    PageReference pr=Page.NewTest;
    pr.setRedirect(true);
    try{
    stdCtrl.save();
    }
    catch(DmlException ex){
    ApexPages.addMessages(ex);  
    }
    if (ApexPages.hasMessages()) pr.setRedirect(false);
       return pr;
    }
}